package com.gdkm.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import com.gdkm.po.Prescription;
import com.gdkm.po.Yu;
@Repository
@Mapper

public interface YuDao {
	@Insert("insert into yuyue(name,type,classes,data) "
			+ "values(#{name},#{type},#{classes},#{data})")
	void save1(String name,String type,String classes,String data);

	@Select("SELECT * FROM yuyue WHERE name LIKE concat('%',#{name},'%') && classes LIKE concat('%',#{classes},'%') limit #{y},#{ge}")
	List<Yu> list3(String name, String classes, int y, int ge);

	@Select("SELECT * FROM yuyue  limit #{y},#{ge}")
	List<Yu> list2(int y, int ge);

	@Update("UPDATE  yuyue set name=#{name},classes=#{classes},type=#{type} where id=#{id}")
	void update(Yu stu);

	@Delete("DELETE FROM yuyue where id=#{id}")
	void delete1(int id);
	
	@Select("SELECT * FROM yuyue where name=#{name}")
	List<Yu> list4(String name);
}
